package org.op.editor;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import org.op.util.MessageController;

public class SearchDialogViewImpl implements SearchDialogView {

	private MessageController messageController;
	private String lastValue = "";
	private JFrame parent;
	
	public String openAndGet() {
		//String str = JOptionPane.showInputDialog(null, messageController.getLabel("edit.find"), "", 1);
		String title = messageController.getLabel("edit.find");
		String label = messageController.getLabel("edit.find");
		String str = (String) JOptionPane.showInputDialog(parent, label, title,JOptionPane.QUESTION_MESSAGE, null, null, lastValue);
		lastValue = str;
		return str;
	}

	public MessageController getMessageController() {
		return messageController;
	}

	public void setMessageController(MessageController messageController) {
		this.messageController = messageController;
	}

	public JFrame getParent() {
		return parent;
	}

	public void setParent(JFrame parent) {
		this.parent = parent;
	}


}
